package com.wuyan.locationdog.adapter

import android.widget.ImageView
import android.widget.TextView
import androidx.annotation.LayoutRes
import com.arcsoft.commonbase.bean.DataBean
import com.arcsoft.commonbase.bean.PointBean
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.wuyan.locationdog.R
import com.wuyan.locationdog.help.DogHelp


class MarkListAdapter(@LayoutRes layoutResId: Int, data: MutableList<PointBean>?) :
    BaseQuickAdapter<PointBean, BaseViewHolder>(layoutResId, data) {


    override fun convert(holder: BaseViewHolder, item: PointBean) {
        holder.apply {
            getView<TextView>(R.id.pointName).setText(item.pointName)
            getView<TextView>(R.id.modifyTime).setText("时间：" + item.modifyTime)


            val imageView = getView<ImageView>(R.id.pointType)

            var pointType = item.pointType
            if (pointType > 0) {
                pointType -= 1
            }

            imageView.setImageResource(DogHelp.getMarkList()[pointType].img)

        }
    }
}




